set (sm_element
    Elements/structuralelementevaluator.cpp
    Elements/igaelements.cpp
    Elements/structuralelement.cpp
    Elements/nlstructuralelement.cpp
    Elements/structural2delement.cpp
    Elements/structural3delement.cpp
    Elements/3D/space3delementevaluator.cpp
    Elements/3D/lspace.cpp 
    Elements/3D/lspacebb.cpp
    Elements/3D/qspace.cpp 
    Elements/3D/qspacegrad.cpp
    Elements/3D/q27space.cpp
    Elements/3D/ltrspace.cpp 
    Elements/3D/qtrspace.cpp 
    Elements/3D/qtrspacegrad.cpp
    Elements/3D/lwedge.cpp 
    Elements/3D/qwedge.cpp 
    Elements/3D/macrolspace.cpp
    Elements/3D/qspacegrad.cpp
    Elements/3D/qwedgegrad.cpp
    Elements/Bars/truss1d.cpp 
    Elements/Bars/truss2d.cpp 
    Elements/Bars/truss3d.cpp
    Elements/Bars/qtruss1d.cpp 
    Elements/Bars/qtruss1dgrad.cpp
    Elements/Beams/libeam2d.cpp 
    Elements/Beams/libeam2dnl.cpp
    Elements/Beams/libeam3d.cpp 
    Elements/Beams/libeam3dnl.cpp 
    Elements/Beams/libeam3dnl2.cpp 
    Elements/Beams/libeam3d2.cpp
    Elements/Beams/beambaseelement.cpp
    Elements/Beams/beam2d.cpp 
    Elements/Beams/beam3d.cpp
    Elements/Plates/cct.cpp
    Elements/Plates/dkt.cpp 
    Elements/Plates/qdkt.cpp
    Elements/Plates/quad1mindlin.cpp
    Elements/Plates/dkt3d.cpp
    Elements/Shells/rershell.cpp 
    Elements/Shells/tr_shell01.cpp 
    Elements/Shells/tr_shell02.cpp 
    Elements/Shells/cct3d.cpp
    Elements/Shells/quad1mindlinshell3d.cpp
    Elements/Shells/shell7base.cpp
    Elements/Shells/tr2shell7.cpp
    Elements/Shells/shell7basexfem.cpp
    Elements/Shells/tr2shell7xfem.cpp
    Elements/Shells/mitc4.cpp
    Elements/Axisymmetry/q4axisymm.cpp
    Elements/Axisymmetry/axisymm3d.cpp 
    Elements/Axisymmetry/l4axisymm.cpp
    Elements/PlaneStrain/quad1planestrain.cpp 
    Elements/PlaneStrain/qplanestrain.cpp 
    Elements/PlaneStrain/qplanestraingrad.cpp
    Elements/PlaneStrain/qtrplanestrain.cpp 
    Elements/PlaneStrain/qtrplanestraingrad.cpp
    Elements/PlaneStrain/trplanestrain.cpp 
    Elements/PlaneStress/planestresselementevaluator.cpp
    Elements/PlaneStress/trplanrot.cpp
    Elements/PlaneStress/trplanstrss.cpp 
    Elements/PlaneStress/qplanstrss.cpp 
    Elements/PlaneStress/q9planstrss.cpp 
    Elements/PlaneStress/qtrplstr.cpp 
    Elements/PlaneStress/planstrss.cpp
    Elements/PlaneStress/planstrssxfem.cpp
    Elements/PlaneStress/trplanstrssxfem.cpp
    Elements/PlaneStress/qtrplanstrssxfem.cpp
    Elements/PlaneStress/qtrplstrgrad.cpp
    Elements/PlaneStress/trplanrot3d.cpp
    Elements/PlaneStress/qplanestressgrad.cpp
    Elements/PlaneStress/trplanestressrotallman.cpp
    Elements/PlaneStress/basicelement.cpp
    Elements/PlaneStress/trplanestressrotallman3d.cpp
    Elements/PlaneStress/linquad3d_planestress.cpp
    Elements/AbaqusUserElement.cpp
    Elements/htselement.cpp
    Elements/latticestructuralelement.cpp
    Elements/graddpelement.cpp 
    Elements/lumpedmasselement.cpp
    Elements/springelement.cpp
    Elements/lattice2d.cpp
    Elements/tet21ghostsolid.cpp
    Elements/quad1platesubsoil.cpp 
    Elements/quad2platesubsoil.cpp
    Elements/tria1platesubsoil.cpp
    Elements/linedistributedspring.cpp
    Elements/trwarp.cpp
    Elements/PlaneStress/basicelement.cpp
    Elements/nodalspringelement.cpp
    Elements/structural2delement.cpp
    Elements/structural3delement.cpp
    #Elements/phasefieldelement.cpp
    #qplanstrssphf.cpp
    )

set (sm_interface_elements
    Elements/Interfaces/cohsur3d.cpp
    Elements/Interfaces/structuralinterfaceelement.cpp
    Elements/Interfaces/intelpoint.cpp
    Elements/Interfaces/intelline1.cpp
    Elements/Interfaces/intelline1intpen.cpp
    Elements/Interfaces/intelline2.cpp
    Elements/Interfaces/intelline2intpen.cpp
    Elements/Interfaces/intelsurftr1.cpp
    Elements/Interfaces/Deprecated/interfaceelement1d.cpp
    Elements/Interfaces/Deprecated/interfaceelem2dlin.cpp
    Elements/Interfaces/Deprecated/interfaceelem2dquad.cpp
    Elements/Interfaces/Deprecated/interfaceelem3dtrlin.cpp
    )

set (sm_boundary_conditions
    Deprecated/prescribedgenstrainshell7.cpp
    )

set (sm_crosssection
    CrossSections/structuralcrosssection.cpp
    CrossSections/simplecrosssection.cpp
    CrossSections/layeredcrosssection.cpp
    CrossSections/fiberedcs.cpp
    CrossSections/structuralinterfacecrosssection.cpp
    CrossSections/variablecrosssection.cpp
    CrossSections/warpingcrosssection.cpp
    )

set (sm_emodel
    EngineeringModels/structengngmodel.cpp
    EngineeringModels/staticstructural.cpp
    EngineeringModels/linearstatic.cpp
    EngineeringModels/nlinearstatic.cpp
    EngineeringModels/nlineardynamic.cpp
    EngineeringModels/eigenvaluedynamic.cpp
    EngineeringModels/linearstability.cpp
    EngineeringModels/adaptlinearstatic.cpp
    EngineeringModels/adaptnlinearstatic.cpp
    EngineeringModels/deidynamic.cpp
    EngineeringModels/diidynamic.cpp
    EngineeringModels/nldeidynamic.cpp
    EngineeringModels/incrementallinearstatic.cpp
    EngineeringModels/freewarping.cpp 
    EngineeringModels/structuralmaterialevaluator.cpp
    EngineeringModels/qclinearstatic.cpp
    )

set (sm_loads
    Loads/tf1.cpp
    Loads/usrdeftempfield.cpp
    Loads/foreigntempfieldload.cpp
    Loads/rotatingboundary.cpp
    Loads/constantpressureload.cpp
    Loads/structtemperatureload.cpp
    Loads/structeigenstrainload.cpp
    )

set (sm_material
    Materials/abaqususermaterial.cpp
    Materials/structuralmaterial.cpp
    Materials/linearelasticmaterial.cpp
    Materials/isolinearelasticmaterial.cpp
    Materials/anisolinearelasticmaterial.cpp
    Materials/ortholinearelasticmaterial.cpp
    Materials/BoneMaterials/trabbonematerial.cpp 
    Materials/BoneMaterials/trabbonenl3d.cpp 
    Materials/BoneMaterials/trabbonenl.cpp 
    Materials/BoneMaterials/trabbone3d.cpp 
    Materials/BoneMaterials/trabboneembed.cpp 
    Materials/BoneMaterials/trabbonenlembed.cpp 
    Materials/BoneMaterials/trabbonegrad3d.cpp
    Materials/ConcreteMaterials/concrete2.cpp 
    Materials/ConcreteMaterials/concrete3.cpp 
    Materials/ConcreteMaterials/concretedpm.cpp 
    Materials/ConcreteMaterials/concretedpm2.cpp
    Materials/ConcreteMaterials/idm1.cpp 
    Materials/ConcreteMaterials/idmnl1.cpp 
    Materials/ConcreteMaterials/idmgrad1.cpp
    Materials/ConcreteMaterials/mazarsmodel.cpp 
    Materials/ConcreteMaterials/mazarsmodelnl.cpp
    Materials/ConcreteMaterials/mplasticmaterial2.cpp
    Materials/ConcreteMaterials/compodamagemat.cpp
    Materials/ConcreteMaterials/concretefcm.cpp
    Materials/ConcreteMaterials/frcfcm.cpp
    Materials/ConcreteMaterials/frcfcmnl.cpp
    Materials/RheoChainMaterials/rheoChM.cpp 
    Materials/RheoChainMaterials/maxwellChM.cpp 
    Materials/RheoChainMaterials/kelvinChM.cpp
    Materials/RheoChainMaterials/kelvinChSolM.cpp
    Materials/RheoChainMaterials/cebfip78.cpp
    Materials/RheoChainMaterials/doublepowerlaw.cpp
    Materials/RheoChainMaterials/b3mat.cpp
    Materials/RheoChainMaterials/b3solidmat.cpp
    Materials/RheoChainMaterials/mps.cpp
    Materials/RheoChainMaterials/mpsdammat.cpp
    Materials/RheoChainMaterials/eurocode2creep.cpp
    Materials/structuralfe2material.cpp
    Materials/rcsd.cpp 
    Materials/rcsde.cpp 
    Materials/rcsdnl.cpp
    Materials/mooneyrivlin.cpp
    Materials/m4.cpp
    Materials/microplane_m1.cpp
    Materials/druckerPragerPlasticitySM.cpp
    Materials/druckerpragercutmat.cpp
    Materials/j2mat.cpp
    Materials/mdm.cpp
    Materials/micromaterial.cpp
    Materials/hyperelasticmaterial.cpp
    Materials/misesmat.cpp 
    Materials/misesmatgrad.cpp 
    Materials/misesmatnl.cpp
    Materials/rankinemat.cpp
    Materials/rankinematgrad.cpp
    Materials/rankinematnl.cpp
    Materials/latticematstatus.cpp
    Materials/latticedamage2d.cpp
    Materials/dustmat.cpp
    Materials/lsmastermat.cpp
    Materials/lsmastermatgrad.cpp
    Materials/simplevitrificationmaterial.cpp
    Materials/anisodamagemodel.cpp
    Materials/winklerpasternak.cpp
    Materials/winklermodel.cpp
    Materials/structmatsettable.cpp
    Materials/tutorialmaterial.cpp
    Materials/graddpmaterialextensioninterface.cpp
    Materials/rcm2.cpp
    Materials/isodamagemodel.cpp
    Materials/steelrelaxmat.cpp
    Materials/fcm.cpp
    )

if (USE_PYTHON)
    list (APPEND sm_material Materials/structuralpythonmaterial.cpp)
endif ()

set (sm_interface_materials
    Materials/InterfaceMaterials/structuralinterfacematerial.cpp
    Materials/InterfaceMaterials/bondceb.cpp
    Materials/InterfaceMaterials/cohint.cpp
    Materials/InterfaceMaterials/intmatelastic.cpp
    Materials/InterfaceMaterials/intmatbilinczfagerstrom.cpp
    Materials/InterfaceMaterials/intmatbilinczjansson.cpp
    Materials/InterfaceMaterials/intmatbilinearcz.cpp
    Materials/InterfaceMaterials/intmatbilinczelastic.cpp
    Materials/InterfaceMaterials/intmatbilinczfagerstromrate.cpp
    Materials/InterfaceMaterials/intmatisodamage.cpp
    Materials/InterfaceMaterials/intmatisodamagetable.cpp
    Materials/InterfaceMaterials/intmatcoulombcontact.cpp
    Materials/InterfaceMaterials/intmatdummycz.cpp    
    Materials/InterfaceMaterials/Deprecated/isointerfacedamage01.cpp
    Materials/InterfaceMaterials/Deprecated/isointerfacedamage02.cpp
    Materials/InterfaceMaterials/Deprecated/simpleinterfacemat.cpp
    Materials/InterfaceMaterials/masonry02.cpp
    Materials/InterfaceMaterials/mat_cebfip90.cpp
    )

set (sm_error
    ErrorEstimators/huertaerrorestimator.cpp
    ErrorEstimators/zzerrorestimator.cpp
    ErrorEstimators/combinedzzsiee.cpp
    ErrorEstimators/scalarerrorindicator.cpp
    ErrorEstimators/directerrorindicatorrc.cpp
    )

set (sm_export
    export/dmexportmodule.cpp
    export/poiexportmodule.cpp
    export/gnuplotexportmodule.cpp
    )

set (sm_barrier
    polylinenonlocalbarrier.cpp
    symmetrybarrier.cpp
    )

set (sm_status
    Materials/structuralms.cpp
    Materials/InterfaceMaterials/structuralinterfacematerialstatus.cpp
    Materials/deformationtheorymaterial.cpp
    Materials/microplanematerial.cpp 
    Materials/microplanematerial_bazant.cpp
    )

set (sm_xfem
    xfem/xfemstructuralelementinterface.cpp
    xfem/enrichmentitems/crack.cpp
    xfem/enrichmentitems/delamination.cpp
    xfem/enrichmentitems/shellcrack.cpp
    xfem/propagationlaws/plhoopstresscirc.cpp
    xfem/propagationlaws/plprincipalstrain.cpp
    xfem/propagationlaws/plmaterialforce.cpp
    xfem/propagationlaws/plczdamageradius.cpp
    xfem/xfemstructuremanager.cpp
    xfem/matforceevaluator.cpp
    xfem/nucleationcriteria/ncprincipalstress.cpp
    xfem/nucleationcriteria/ncprincipalstrain.cpp
    EngineeringModels/xfemsolverinterface.cpp
    )

set (sm_unsorted
    particle.cpp
    refinedelement.cpp
    refinedmesh.cpp
    microplane.cpp
    gpinitmodule.cpp
    stressstrainbasevector.cpp stressvector.cpp strainvector.cpp
    mappers/primvarmapper.cpp
    Contact/cdefnode2node.cpp
    Contact/celnode2node.cpp
    )

set (sm_parallel
    FETISolver/feticommunicator.cpp
    FETISolver/fetiboundarydofman.cpp
    FETISolver/fetisolver.cpp
    )

set (sm_obsolete
    Materials/Obsolete/steel1.cpp
    Materials/Obsolete/plasticmaterial.cpp
    Materials/Obsolete/perfectlyplasticmaterial.cpp
    Materials/Obsolete/j2plasticmaterial.cpp
    Materials/Obsolete/mplasticmaterial.cpp
    Materials/Obsolete/j2mplasticmaterial.cpp
    Materials/Obsolete/rankinepm.cpp
    )

set (sm_quasicontinuum
    Quasicontinuum/quasicontinuum.cpp
    Quasicontinuum/quasicontinuumnumberingscheme.cpp
    Quasicontinuum/quasicontinuumvtkxmlexportmodule.cpp    
    Quasicontinuum/fullsolveddomain.cpp
    Quasicontinuum/geometrygenerator.cpp
    )

set (sm
    ${sm_element}
    ${sm_interface_elements}
    ${sm_crosssection}
    ${sm_loads}
    ${sm_emodel}
    ${sm_material}
    ${sm_interface_materials}
    ${sm_status}
    ${sm_export}
    ${sm_barrier}
    ${sm_error}
    ${sm_xfem}
    ${sm_unsorted}
    ${sm_obsolete}
    ${sm_new}
    ${sm_boundary_conditions}
    ${sm_quasicontinuum} 
    )

file(GLOB_RECURSE project_headers *.h)
file(GLOB_RECURSE project_cpps *.cpp)
set(all_files ${project_headers} ${project_cpps})
source_group_by_dir(all_files)

if (USE_PARALLEL)
    list (APPEND sm ${sm_parallel})
endif ()

add_library(sm
    ${LIB_TYPE}
    ${sm}
    #headers
    ${project_headers}
    )

# Not included:
#pnldeidynamiccomm
